[IA64] Fix of C/S 10529:4260eb8c08740de0000081c61a6237ffcb95b2d5 for IA64.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 27 Jul 2006 12:17:17 +0000 (13:17 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 27 Jul 2006 12:17:17 +0000 (13:17 +0100)
When page is zapped from a domain, the page referenced counter
is checked. But it results in false positive alert on Xen/IA64
because a page 'in use' has reference count 2 on Xen/IA64.
- a page is assigned to guest domain's psudo physical address space.
  This is decremented by guest_physmap_remove_page()
- a page is allocated for a domain.
  This is decremented by the following put_page()

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
xen/common/memory.c
xen/include/asm-ia64/mm.h
xen/include/asm-x86/mm.h

index 8ed125e98dba0d190cce1e537fa6518e306c8d7c..0a631ca83e8a980993a029353733b5787e8daadc 100644 (file)
@@ -170,7 +170,7 @@ guest_remove_page(
     if ( test_and_clear_bit(_PGC_allocated, &page->count_info) )
         put_page(page);
 
-    if ( unlikely((page->count_info & PGC_count_mask) != 1) )
+    if ( unlikely(!page_is_removable(page)) )
     {
         /* We'll make this a guest-visible error in future, so take heed! */
         DPRINTK("Dom%d freeing in-use page %lx (pseudophys %lx):"
index 2ac3d434871968ac2ab5abfa28ccb6579c9e780b..1ec08acce3ea095acbe4ab7687aab966161a9c00 100644 (file)
@@ -213,6 +213,11 @@ static inline int get_page_and_type(struct page_info *page,
     return rc;
 }
 
+static inline int page_is_removable(struct page_info *page)
+{
+    return ((page->count_info & PGC_count_mask) == 2);
+}
+
 #define        set_machinetophys(_mfn, _pfn) do { } while(0);
 
 #ifdef MEMORY_GUARD
index 0e4e23b4b9e487de895a2a63f33e7dc85e273750..df2875f1e772129cf147d973f30475aa82cbd70d 100644 (file)
@@ -241,6 +241,11 @@ static inline int get_page_and_type(struct page_info *page,
     return rc;
 }
 
+static inline int page_is_removable(struct page_info *page)
+{
+    return ((page->count_info & PGC_count_mask) == 1);
+}
+
 #define ASSERT_PAGE_IS_TYPE(_p, _t)                            \
     ASSERT(((_p)->u.inuse.type_info & PGT_type_mask) == (_t)); \
     ASSERT(((_p)->u.inuse.type_info & PGT_count_mask) != 0)